package com.baizhi.config;
/**
 * 配置类
 */
import com.baizhi.interceptors.JwtTokenInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       //添加拦截器以及拦截的位置       /* 表示拦截一级目录,    /** 表是拦截多级目录
        registry.addInterceptor(new JwtTokenInterceptor()).
                excludePathPatterns("/user/**")//表示放行的路径
                .addPathPatterns("/**");
    }
}
